#include <stdlib.h>
#include <time.h>
#include <string>
#include <iostream>
#include <vector>

using namespace std;

int main()
{
    srand(time(NULL));
    int n;
    int cnt = 0;
    cin>>n;
    cout<<n<<endl;
    vector<string> p;
    string target;
    char *buf = new char[n];
    for(int i = 0;i < n;++i)
    {
        size_t len = (rand()%n) + 3;
        for(int j = 0;j<len;++j)
        {
            buf[j] = rand()%26 + 'a';
        }
        buf[len] = 0;
        string strin(buf);
        target += strin;
        if(rand()%100 < 30 && cnt < n)
        {
            p.push_back(strin);
            ++cnt;
        }
    }
    for(int i = 0;i < cnt;++i)
    {
        cout<<p[i]<<endl;
    }
    for(int i = cnt;i < n;++i)
    {
        int len = rand()%n + 3;
        for(int j = 0;j < len;++j)
        {
            char c = rand()%26 + 'a';
            cout<<c;
        }
        cout<<endl;
    }
    cout<<target;
    return 0;
}